{template 'admin','header'}
<form action="{$self_url}?action=search" onsubmit="return r_submit(this);">
<table width="100%" cellpadding="0">
<tr>
	<td width="180">&nbsp;&nbsp;<strong>关键字:</strong><input value="{if $kw!==false}{$kw}{/if}" type="text" name="kw"></td>
	<td width="120"><strong>状态:</strong><select name="passed"><option value="-1">全部</option><option value="0" {if $passed==='0'}selected{/if}>未审核</option><option value="1" {if $passed=='1'}selected{/if}>审核通过</option><option value="2" {if $passed=='2'}selected{/if}>审核未通过</option></select></td>
	<td width="90"><strong>来源:</strong><select name="flag">
	{loop $comment_config $key $config}
	<option value="{$key}" {if $key==$flag}selected{/if}>{$config['name']}</option>
	{/loop}
	</select></td>
	<td width="180"><strong>宿主id:</strong><input type="text" value="{if intval($nid)>0}{$nid}{/if}" name="nid"></td>	
	<td width="140"><strong>评论时间:</strong>
						<select name="time">
							<option value="0">全部</option>
							<option value="1d" {if $time=='1d'}selected{/if}>1天内</option>
							<option value="2d" {if $time=='2d'}selected{/if}>2天内</option>
							<option value="3d" {if $time=='3d'}selected{/if}>3天内</option>
							<option value="1w" {if $time=='1w'}selected{/if}>1周内</option>
							<option value="2w" {if $time=='2w'}selected{/if}>2周内</option>
							<option value="1m" {if $time=='1m'}selected{/if}>1个月内</option>
							<option value="2m" {if $time=='2m'}selected{/if}>2个月内</option>
							<option value="3m" {if $time=='3m'}selected{/if}>3个月内</option>
							<option value="6m" {if $time=='6m'}selected{/if}>6个月内</option>
							<option value="1y" {if $time=='1y'}selected{/if}>1年内</option>
						</select>
	</td>
	<td><input type="submit" value="搜索"></td>	
</tr>
</table>
</form>

<form name='form1' action="{$self_url}?action=delall" method="POST" onsubmit="return r_submit(this);">
<table class="table_list">
 <caption>评论管理列表</caption>
 <tr>
 {if check_perms('com003')===true}
	 <th width="80" class="align_c"><input type="checkbox" onclick="checkall(this,'ck')" id="chkall">全选/取消</th>
 {/if}
	 <th class="align_c">内容</th>
	 <th class="align_c">评论主题</th>
	 <th class="align_c" width="150">评论时间</th>
	 <th class="align_c" width="150">评论人</th>
	 <th class="align_c" width="80">状态</th>
	 <th width="250" class="align_c">操作</th>
 </tr>
 {loop $list $c}
 <tr>
 {if check_perms('com003')===true}
 <td class="align_c"><input type="checkbox" id="ck" value="{$c['commentid']}" name="ck[]"></td>
 {/if}
 <td>{text2html($c['content'],100)}</td>
 <td class="align_c"><a href="{$c['url']}" target="_blank">{$c['title']}</a></td>
 <td class="align_c">{date('Y-m-d H:i:s',$c['addtime'])}</td>
 <td class="align_c">{$c['username']}</td>
 <td class="align_c">{if $c['passed']=='1'}审核通过{elseif $c['passed']=='2'}审核未通过{else}未审核{/if}</td>
 <td class="align_c">
 {if check_perms('com004')===true}
	 {if $c['passed']=='0'}
	 	<a href="javascript:my_request('{$self_url}?action=pass&cid={$c['commentid']}&vl={COMMENT_PASS_PASSED}&forward={$forward}','确认要进行此操作吗？')">通过</a> | 
	 	<a href="javascript:my_request('{$self_url}?action=pass&cid={$c['commentid']}&vl={COMMENT_PASS_NOPASSED}&forward={$forward}','确认要进行此操作吗？')">不通过</a> |
	 {else}
	 	 <a href="javascript:my_request('{$self_url}?action=pass&cid={$c['commentid']}&vl={COMMENT_PASS_NOAUDIT}&forward={$forward}','确认要进行此操作吗？')">恢复为未审核</a> |
	 {/if}
 {/if}
 	{if check_perms('com002')===true}<a href="{$self_url}?action=edit&cid={$c['commentid']}&forward={$forward}">修改</a> | {/if}
 	{if check_perms('com003')===true}<a href="javascript:my_request('{$self_url}?action=del&cid={$c['commentid']}','确认要删除吗？')">删除</a>{/if}
 </td>
 </tr>
 {/loop}
</table>
<div class="button_box">
{if check_perms('com003')===true}
<input type="button" value="批量删除" onclick="if(confirm('确定要删除选中的评论？')){change_opt('form1','{$self_url}?action=delall');}" class="button_style">
{/if}
</div>
</form>

<div id="pages">
{$pages}
</div>
{template 'admin','footer'}